<template>
	<view class="wrap" style="padding-bottom: 60px;">
		<u-tabs :list="list" :is-scroll="false" :current="current" @change="change"></u-tabs>
		<!-- 当前套餐 -->
		<view v-if="current === 0">
			<u-form  :data="user" ref="user" class="apply-form-field">
				<!-- <u-gap height="20" bg-color="#f5f5f5"></u-gap> -->

               <div v-if="user.cylinderNumber!=null">
                 <div style="text-align: center;justify-content: center;display: flex;">
                   <image src="/static/new/top0.png" style="width: 100%;height: 190px"></image>
                 </div>

                 <div style="text-align: center;justify-content: center;display: flex;">
                 <image src="/static/new/top1.png" style="width: 140px;height: 56px;"></image>
                 </div>

                <u-form-item label="钢瓶编号" prop="cylinderNumber" label-width="150">
									<u-input v-model="user.cylinderNumber" placeholder="请输入" type="input" class="form-field-select" disabled/>
								</u-form-item>

								<u-form-item label="所属气站" prop="belongingGasStation" label-width="150" :label-position="labelPosition">
									 <u-input v-model="user.belongingGasStation" type="input" class="form-field-select" disabled/>
								</u-form-item>

								<u-form-item label="钢瓶容积" prop="volume" label-width="150" >
								    <u-input v-model="user.volume" placeholder="请输入" type="input"  class="form-field-select" disabled/>
								</u-form-item>
						
								<u-form-item label="钢瓶重量"  prop="weight" label-width="150" >
								    <u-input v-model="user.weight" placeholder="请输入" type="input" class="form-field-select" disabled/>
								</u-form-item>
								<u-form-item label="生产日期" prop="manufactureDate" label-width="150" >
								    <u-input v-model="user.manufactureDate"    placeholder="请输入(例如:2022-01-01)" type="input" class="form-field-select" disabled/>
								</u-form-item>
								<u-form-item label="报废日期" prop="scrapDate" label-width="150" >
								    <u-input v-model="user.scrapDate" placeholder="请输入(例如:2022-01-01)"  type="input" class="form-field-select" disabled/>
								</u-form-item>
								
								<u-form-item label="气瓶检测日期" prop="inspectionTime" label-width="190" >
								    <u-input v-model="user.inspectionTime"    placeholder="请输入(例如:2022-01-01)" type="input" class="form-field-select" disabled/>
								</u-form-item>
								<u-form-item label="下次检测日期" prop="nextInspectionTime" label-width="190" >
								    <u-input v-model="user.nextInspectionTime" placeholder="请输入(例如:2022-01-01)"  type="input" class="form-field-select" disabled/>
								</u-form-item>

								<u-form-item label="钢瓶状态" prop="cylinderStatus" label-width="150" :label-position="labelPosition">
									<u-input v-model="user.cylinderStatus"  type="input" class="form-field-select" disabled/>
								</u-form-item>

								<u-form-item label="应充介质" prop="gasMedia" label-width="150" :label-position="labelPosition">
									<u-input v-model="user.gasMedia"  type="input" class="form-field-select" disabled/>
								</u-form-item>

                <!-- 以下为充装信息,判断是否有充气记录 -->
                <div v-if="user.fillingStation!=null">

                  <div style="text-align: center;justify-content: center;display: flex;">
                    <image src="/static/new/top2.png" style="width: 140px;height: 56px;"></image>
                  </div>
<!--                <u-gap height="20" bg-color="#f5f5f5"></u-gap>-->

                <u-form-item label="充装人姓名" prop="name" label-width="150" >
                  <u-input v-model="user.name" placeholder="" type="input" class="form-field-select" disabled/>
                </u-form-item>
                <u-form-item label="充装人单位" prop="workPlace" label-width="150">
                  <u-input v-model="user.workPlace" placeholder="" type="input" class="form-field-select" disabled/>
                </u-form-item>
                <u-form-item label="充装人工号" prop="userName" label-width="150" >
                  <u-input v-model="user.userName"placeholder="" type="input" class="form-field-select" disabled/>
                </u-form-item>

<!--                <u-gap height="20" bg-color="#f5f5f5"></u-gap>-->
								
								<u-form-item label="充装气站" prop="fillingStation"  label-width="150" :label-position="labelPosition">
									<u-input v-model="user.fillingStation"  type="input" class="form-field-select" disabled/>
								</u-form-item>
								
								<u-form-item label="充装介质" prop="fillingMedium" label-width="150" :label-position="labelPosition">
									<u-input v-model="user.fillingMedium"  type="input" class="form-field-select" disabled/>
								</u-form-item>
								
								<u-form-item label="充装开始时间" prop="fillingTime" label-width="180">
								  <u-input v-model="user.note1" placeholder="请输入(例如:2022-01-01)" type="input" class="form-field-select" disabled/>
								</u-form-item>
								<u-form-item label="充装结束时间" prop="fillingTime" label-width="180">
								  <u-input v-model="user.note1" placeholder="请输入(例如:2022-01-01)" type="input" class="form-field-select" disabled/>
								</u-form-item>

<!--                <u-gap height="20" bg-color="#f5f5f5"></u-gap>-->

                <u-form-item label="瓶体完好程度" prop="integrityBottle" label-width="180" :label-position="labelPosition">
                  <u-input v-model="user.integrityBottle"  type="input" class="form-field-select" disabled/>
                </u-form-item>

                <u-form-item label="阀门完好程度" prop="valveIntegrity" label-width="180" :label-position="labelPosition">
                  <u-input v-model="user.valveIntegrity"  type="input" class="form-field-select" disabled/>
                </u-form-item>

                </div>

                <div v-if="user.fillingStation==null" style="margin-top: 40px;text-align: center;margin-bottom: 40px;font-size: 16px;">
                      该气瓶尚未进行充装
                </div>

               </div>

                <div v-if="user.cylinderNumber==null" style="margin-top: 40px;text-align: center;margin-bottom: 40px;font-size: 16px;">
                      该气瓶尚未建档
                </div>


			</u-form>
			
			
		</view>
	
		
	</view>
</template>
<script>
import Webview from "../../../common/webview.vue";

export default {
  components: {Webview},
	
	
	data() {
			return {
			show: false,			
			user: [],								
			loading: true,			
			total: 0,
			option:[]||"",
			m2mSimflowList:[],
			m2mOrderFlowList:[],
			current: 0,
			a:[],
			status: 'loadmore',
			iconType: 'circle',
			isDot: false,
			loadText: {
						loadmore: '点击加载更多',
						loading: '正在加载...',
						nomore: '没有更多了'
			},
			show_belongingGasStation: false,
			list_belongingGasStation: [
						{
							value: '101',
							label: '锦州御龙气体有限公司'
						},
						{
							value: '102',
							label: '锦州市宏远溶解乙炔有限责任公司'
						},
						{
							value: '103',
							label: '凌海金晟气体有限公司'
						},
						{
							value: '104',
							label: '锦州市天赢气体有限公司'
						},
						{
							value: '105',
							label: '锦州全福气体有限公司'
						},
						{
							value: '106',
							label: '北镇市永峰氧气厂'
						},
            {
							value: '107',
							label: '北镇市英田气体经销处'
						},{
							value: '108',
							label: '黑山洋合九州氧气站'
						},{
							value: '109',
							label: '锦州锦抚气体有限公司'
						},{
							value: '110',
							label: '义县天财气体厂'
						},
						{
							value: '111',
							label: '锦州凤宇乙炔有限公司'
						},
						{
							value: '112',
							label: '锦州市宝钛华神钛业有限公司'
						},
            {
              value: '113',
              label: '锦州市环宇气体有限公司'
            },
			      {
              value: '114',
              label: '锦州安燃高能切割气有限公司'
            },
			],
			// 瓶体完好程度
			show_integrityBottle:false,
			list_integrityBottle: [
						{
							value: '0',
							label: '完好'
						},
						{
							value: '1',
							label: '不完好'
						}
			],
			
			// 阀门完好程度
			show_valveIntegrity:false,
			list_valveIntegrity: [
						{
							value: '0',
							label: '完好'
						},
						{
							value: '1',
							label: '不完好'
						}
			],
			show_cylinderStatus: false,
			list_cylinderStatus: [
						{
							value: '0',
							label: '正常'
						},
						{
							value: '1',
							label: '报废'
						}
			],
			
			show_gasMedia: false,
			list_gasMedia: [
						{
							value: '0',
							label: '氮气'
						},
						{
							value: '1',
							label: '氧气'
						},
						{
							value: '2',
							label: '丙烷'
						},
						{
							value: '3',
							label: '医用氧气'
						},
						{
							value: '4',
							label: '二氧化碳'
						},
						{
							value: '5',
							label: '氩气'
						},
						{
							value: '6',
							label: '氩-二氧化碳混合气'
						},
						{
							value: '7',
							label: '溶解乙炔'
						},
						{
							value: '8',
							label: '乙炔'
						},
						{
							value: '9',
							label: '氢气'
						},
            {
            value: '10',
            label: '氯气'
           },
           {
            value: '11',
            label: '天然气(天然气切割气)'
           },
           {
            value: '12',
            label: '液化天然气(切割气)'
           },
        {
          value: '13',
          label: '氦气'
        },
			],
			show_fillingStation: false,
			list_belongingGasStation: [
						{
							value: '101',
							label: '锦州御龙气体有限公司'
						},
						{
							value: '102',
							label: '锦州市宏远溶解乙炔有限责任公司'
						},
						{
							value: '103',
							label: '凌海金晟气体有限公司'
						},
						{
							value: '104',
							label: '锦州市天赢气体有限公司'
						},
        {
          value: '105',
          label: '锦州全福气体有限公司'
        },
        {
          value: '106',
          label: '北镇市永峰氧气厂'
        },
        {
          value: '107',
          label: '北镇市英田气体经销处'
        },{
          value: '108',
          label: '黑山洋合九州氧气站'
        },{
          value: '109',
          label: '锦州锦抚气体有限公司'
        },{
          value: '110',
          label: '义县天财气体厂'
        },
        {
          value: '111',
          label: '锦州凤宇乙炔有限公司'
        },
        {
          value: '112',
          label: '锦州市宝钛华神钛业有限公司'
        },
        {
          value: '113',
          label: '锦州市环宇气体有限公司'
        },
        {
          value: '114',
          label: '锦州安燃高能切割气有限公司'
        },
			],
			show_fillingMedium: false,
			list_fillingMedium: [
						{
							value: '0',
							label: '氧气'
						},
						{
							value: '1',
							label: '氮气'
						},
						{
							value: '2',
							label: '氢气'
						}
			],
			
			}
		},
		created(){
			
		},
		methods: {
			showVaule(){
				console.log(this.user.belongingGasStation+"7777")
				let a = this.user.gasMedia
				let b = this.user.fillingMedium
				if(a==this.user.belongingGasStation){
					console.log("hello world")
				}
				// if(b==this.user.){
				// 	console.log("hello world")
				// }
			},

      onLoad: function (option) { //option为object类型，会序列化上个页面传递的参数

          // 参数获取
          console.log("7788");
          console.log("decodeURIComponent：" + decodeURIComponent(option.scene) );
          this.a=decodeURIComponent(option.scene);
					this.getList();
					console.log("decodeURIComponent_id:" + this.a);
					
			    },			
			getList() {			  
				
			      this.$u.api.user1.defilleUser1({
					//let id =  sessionStorage.getItem("a");
					id:this.a,
				  }).then(response => {
			      this.user = response.data;
				  for(let i=0;i<this.list_cylinderStatus.length;i++){
				   				  	    if(this.list_cylinderStatus[i].value==this.user.cylinderStatus){
				   				  		    this.user.cylinderStatus = this.list_cylinderStatus[i].label;
				      	    break
				   				  	    }
				      }
				   for(let i=0;i<this.list_belongingGasStation.length;i++){
				   										 console.log(this.user.workplace+"sasd")
				   															if(this.list_belongingGasStation[i].value==this.user.workPlace){
				   																this.user.workPlace = this.list_belongingGasStation[i].label;
				   												break
				   															}
				   										 }
				  for(let i=0;i<this.list_belongingGasStation.length;i++){
				  										 
				  															if(this.list_belongingGasStation[i].value==this.user.belongingGasStation){
				  																this.user.belongingGasStation = this.list_belongingGasStation[i].label;
				  												break
				  															}
				  										 }	
				  for(let i=0;i<this.list_gasMedia.length;i++){
				  					  
				  										if(this.list_gasMedia[i].value==this.user.gasMedia){
				  											this.user.gasMedia = this.list_gasMedia[i].label;
				  							break
				  										}
				  					 }					
				  for(let i=0;i<this.list_gasMedia.length;i++){
				  					  
				  										if(this.list_gasMedia[i].value==this.user.fillingMedium){
				  											this.user.fillingMedium = this.list_gasMedia[i].label;
															console.log(this.user.fillingMedium+"ooo")
				  							break
				  										}
				  					 }	
				
				 for(let i=0;i<this.list_belongingGasStation.length;i++){
										  
															if(this.list_belongingGasStation[i].value==this.user.fillingStation){
																this.user.fillingStation = this.list_belongingGasStation[i].label;
												break
															}
										 }		
				//阀门完好程度
				 for(let i=0;i<this.list_valveIntegrity.length;i++){
				 										if(this.list_valveIntegrity[i].value==this.user.valveIntegrity){
				 											this.user.valveIntegrity = this.list_valveIntegrity[i].label;
				 							break
				 										}
				 					 }
				//	瓶体完好程度 		
						 for(let i=0;i<this.list_integrityBottle.length;i++){
						 										if(this.list_integrityBottle[i].value==this.user.integrityBottle){
						 											this.user.integrityBottle = this.list_integrityBottle[i].label;
						 							break
						 										}
						 					 }			
			      this.loading = false;
			      });
			    },
				
				
				
			change(index) {
				this.current = index;
			},
								    		
		}

	}
</script>
<style lang="scss" scoped>

page {
	background-color: #f5f5f5;
}
.wrap .search{
	background: #ffffff;
}
.apply-text{
	font-size: 28rpx;
	color: #333333;
	span{
		color: #999999;
	}
}
.user-images{
	width: 28px;
	height:28px;
	margin-right: 8px;
}
.apply-list-foot{
	font-size: 28rpx;
}


.personnel-list{
	display: flex;
	align-items: center;
	flex-wrap:wrap;
	.personnel-user{
		position: relative;
		margin: 5px 9px 0;
	}
	.user-images{
		width: 48px;
		height:48px;
		margin-right:0;
		
	}
	.iconfont{
		position: absolute;
		top:-12px;
		right:-5px;
		color: #FE0100;
	}

}

</style>
